package cn.mr;
import org.apache.hadoop.io.Writable;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
public class NewsBean implements Writable {
    private String title;
    private Long heat;
    public String getCategory() {
        return category;
    }
    public void setCategory(String category) {
        this.category = category;
    }
    private String category;
    public Long getHeat() {
        return heat;
    }
    public void setHeat(Long heat) {
        this.heat = heat;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    @Override
    public String toString() {
        return category+ "\t" + title + "\t" + heat + "\t";
    }
    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeUTF(category);
        dataOutput.writeUTF(title);
        dataOutput.writeLong(heat);
    }
    @Override
    public void readFields(DataInput dataInput) throws IOException {
        this.category = dataInput.readUTF();
        this.title = dataInput.readUTF();
        this.heat = dataInput.readLong();
    }
}
